input,
button {
    outline: none;

}

a {
    text-decoration: none;
}

body {
    margin: 0;
    padding: 0;
    font-family: Helvetica, Arial, "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;

    min-height: 100vh;
    /* 取色网站 https://flatuicolors.com/palette/defo */
    background-image: linear-gradient(120deg, #3498db, #8e44ad)
}

.login {
    width: 360px;
    background: #f1f1f1;
    padding: 40px 40px;
    border-radius: 10px;

    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.login .img {
    display: flex;
    justify-content: center;
}

.login .img img {
    width: 50px;
    height: 50px;
}

.login h2 {
    text-align: center;
    margin-bottom: 10px;
}

.txtb {
    border-bottom: 2px solid #adadad;
    margin: 20px 0;

    position: relative;
}

.txtb input {
    outline: none;
    border: none;
    background: none;

    font-size: 15px;
    color: #333;
    width: 100%;
    height: 30px;
    padding: 0 5px;
}

.txtb span::before {
    content: attr(data-placeholder);

    position: absolute;
    top: 50%;
    left: 5px;
    color: #adadad;
    transform: translateY(-50%);
    z-index: -1;
    transition: .5s;
}


.txtb span::after {
    content: "";
    position: absolute;

    width: 0%;
    /* width: 100%;  用js 控制 宽度改变为100% */
    height: 2px;
    background: linear-gradient(120deg, #3498db, #8e44ad);
    transition: .5s;
}

.focus+span::before {
    top: -8px;
}

.focus+span::after {
    width: 100%;
}

.input-btn {
    border: none;
    outline: none;

    display: block;
    width: 100%;
    height: 40px;
    color: #fff;
    cursor: pointer;
    margin-top: 10px;
    border-radius: 3px;

    background: linear-gradient(120deg, #3498db, #8e44ad, #3498db);
    background-size: 200%;

    transition: .5s;
}

.input-btn:hover {
    background-position: right;
}

.login label {
    margin-bottom: 10px;
}

.login label span {
    vertical-align: 2px;
}

.register {
    margin-top: 30px;
    text-align: center;
}